import VueRouter from 'vue-router'

import tabbar from "./components/tabbar.vue"
import member from "./components/member.vue"
import shopcar from "./components/shopcar.vue"
import search from "./components/search.vue"
import newlist from "./newList/newlist.vue"
import newsInfo from "./newList/newsInfo.vue"
import photoshare from "./photoshare/photoshare.vue"
import photoInfo from "./photoshare/photoInfo.vue"
import goodsList from "./goods/goodslist.vue"
import goodInfo from "./goods/goodInfo.vue"
import goDesc from "./goods/goDesc.vue"
import goComments from "./goods/goComments.vue"

// 3. 创建路由对象
var router = new VueRouter({
  routes: [
    {path:"/",redirect:"/tabbar"},
    {path:"/tabbar",component:tabbar},
    {path:"/member",component:member},
    {path:"/shopcar",component:shopcar},
    {path:"/search",component:search},
    {path:"/tabbar/newlist",component:newlist},
    {path:"/tabbar/newsInfo/:id",component:newsInfo},
    {path:"/tabbar/photoshare",component:photoshare},
    {path:"/tabbar/photoshare/:id",component:photoInfo},
    {path:"/tabbar/goodslist",component:goodsList},
    {path:"/tabbar/goodInfo/:id",component:goodInfo},
    {path:"/tabbar/goodInfo/goComments/:id",component:goComments},
    {path:"/tabbar/goodInfo/goDesc/:id",component:goDesc}
  ],
  linkActiveClass:"mui-active"
})

// 把路由对象暴露出去
export default router